package com.example.opengl_test00;

import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;

import javax.microedition.khronos.opengles.GL10;

public class Polygon {
	
	public Polygon() {
		
	}
	
	public void addTriangle(Vertor3f v1, Vertor3f v2, Vertor3f v3) {
		
	}
	
	public void createTexture(GL10 gl, InputStream texture) {
		
	}
	
	public void draw(GL10 gl) {
		
	}
	
	protected FloatBuffer createFloatBuffer(int capacity)
	{
		ByteBuffer byteBuf = ByteBuffer.allocateDirect(capacity);
		byteBuf.order(ByteOrder.nativeOrder());
		return byteBuf.asFloatBuffer();
	}
	
	protected ShortBuffer createShortBuffer(int capacity)
	{
		ByteBuffer byteBuf = ByteBuffer.allocateDirect(capacity);
		byteBuf.order(ByteOrder.nativeOrder());
		return byteBuf.asShortBuffer();
	}
	
	protected static final int FLOAT_SIZE_BYTES = 4;
	protected static final int SHORT_SIZE_BYTES = 2;
	
	protected int mNumberOfVertexes;
	protected int mNumberOfIndexes;
	protected FloatBuffer mVertexBuf;
	protected FloatBuffer mNormalBuf;
	protected FloatBuffer mTextureBuf;
	protected ShortBuffer mIndexBuf;
}
